package com.yxhl.zoume.core.tripsmgmt.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.yxhl.zoume.common.ui.fragment.BaseFragment;

import java.util.List;

/**
 * Created by sugarya on 16/3/27.
 * 行程主页ViewPager适配器
 */
public class HomeTripsPagerAdapter extends FragmentPagerAdapter {

    private List<BaseFragment> fragments;
    private List<String> titles;

    public HomeTripsPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    public HomeTripsPagerAdapter(FragmentManager fm, List<BaseFragment> fragments, List<String> titles) {
        super(fm);
        this.fragments = fragments;
        this.titles = titles;
    }


    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles.get(position);
    }


}
